/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

/**
 *
 * @author Andy
 */
@Entity(name = "CompletedGoods")
public class CompletedGoodsEntity extends ProductEntity implements Serializable {
    
    private int shelfLife; //month
    private double weightPerBar; // gram
    private int capacityPerMin; // number of bars
    private int capacityPerHour; //calculated from capacityPerMin
    
    private int barsPerBox;
    private int boxesPerCase;
            
    private double weightPerBox;
    
    private int barsPerCase;
    
    //private long casesOfHour;
    private double changeoverTime;
 

     @OneToMany(mappedBy = "product", cascade = {CascadeType.ALL})
    private Collection<ReservationEntity> reservations = new ArrayList<ReservationEntity>();
     
     
    @OneToMany(mappedBy = "product")
    private Collection<PickingOrderEntity> pickingOrder = new ArrayList<PickingOrderEntity>();

    private double weightPerCase;
    
    @OneToOne(cascade={CascadeType.ALL}) 
    private BillOfMaterialEntity bom;

    public CompletedGoodsEntity() {
        super();
    }
    
    
    public int getBoxesPerCase(){
        return boxesPerCase;
    }
    
    public void setBoxesPerCase(int boxesPerCase){
        this.boxesPerCase = boxesPerCase;
    }
    
    public int getCapacityPerHour(){
        return capacityPerHour;
    }
    
    public void setCapacityPerHour(int capacityPerHour){
        this.capacityPerHour = capacityPerHour;
    }
    
    public double getWeightPerBar(){
        return weightPerBar;
    }
    
    public void setWeightPerBar(double weightPerBar){
        this.weightPerBar = weightPerBar;
    }
    
    public BillOfMaterialEntity getBom(){
        return bom;
    }
    
    public void setBom(BillOfMaterialEntity bom){
        this.bom = bom;
    }
    
    public double getWeightPerCase(){
        return weightPerCase;
    }
    
    public void setWeightPerCase(double weight){
        weightPerCase = weight;
    }

        public Collection<PickingOrderEntity> getPickingOrder() {
        return pickingOrder;
    }

    public void setPickingOrder(Collection<PickingOrderEntity> pickingOrder) {
        this.pickingOrder = pickingOrder;
    }
    
    public Collection<ReservationEntity> getReservations() {
        return reservations;
    }

    public void setReservations(Collection<ReservationEntity> reservations) {
        this.reservations = reservations;
    }
    
    public int getBarsPerBox() {
        return barsPerBox;
    }

    public void setBarsPerBox(int barsPerBox) {
        this.barsPerBox = barsPerBox;
    }

    public int getBarsPerCase() {
        return barsPerCase;
    }

    public void setBarsPerCase(int barsPerCase) {
        this.barsPerCase = barsPerCase;
    }

    public int getCapacityPerMin() {
        return capacityPerMin;
    }

    public void setCapacityPerMin(int capacityPerMin) {
        this.capacityPerMin = capacityPerMin;
    }

    public double getChangeoverTime() {
        return changeoverTime;
    }

    public void setChangeoverTime(double changeoverTime) {
        this.changeoverTime = changeoverTime;
    }

    public int getShelfLife() {
        return shelfLife;
    }

    public void setShelfLife(int shelfLife) {
        this.shelfLife = shelfLife;
    }

    public double getWeightPerBox() {
        return weightPerBox;
    }

    public void setWeightPerBox(double weightPerBox) {
        this.weightPerBox = weightPerBox;
    }
//
//    public long getCasesOfHour() {
//        return casesOfHour;
//    }
//
//    public void setCasesOfHour(long casesOfHour) {
//        this.casesOfHour = casesOfHour;
//    }
   
    
}
